<?php
class filter_categoryModel extends baseModel{
    protected $table = 'filter_category';

    //多维分类列表
    public function filter_category_list() {
        return $this->select('','','cid asc');
    }

    //多维分类信息
    public function info($cid) {
        return $this->find('cid='.$cid);
    }

    //添加多维分类
    public function add($data)
    {

        return $this->insert($data);
    }
    //编辑多维分类
    public function edit($data)
    {
        $condition['cid']=intval($data['cid']);
        return $this->update($condition,$data); 
    }
    //删除多维分类
    public function del($cid)
    {
        $list=model('filter_list')->filter_list_list($cid);
        if(!empty($list)){
            foreach ($list as $value) {
                model('filter_list')->del($value['fid']);
            }
        }
        return $this->delete('cid='.intval($cid)); 
    }

	
}